<?php

class textCleanerForm extends textCleaner {
	/**
	* Maximum number of characters allowed in a string to be parsed 
	*/
	protected $max_str_length = 100000;
    /**
    * Build an array of custom character replacements
    */
	protected $custom_chars = array();
	
	public $links_label =
		array('value' => 'Link conversion');
	
	public $links_options =
		array(
			'none' => 'Convert nothing',
			'url' => 'URLs only',
			'email' => 'Email addresses only',
			'all' => 'URLs and Emails'
		);
	
	public $encoding_label =
		array('value' => 'Character encoding');
	
	public $encoding_options = 
		array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1');

	public $break_types_label = 
		array(
			'value' => 'Paragraph seperator type',
			'attr' => array('class' => 'tight')
			);
	
	public $break_types = 
		array(
			'none' => 'Regular line breaks',
			'paragraph' => 'HTML paragraph tags',
			'break' => 'HTML break tags',
			'custom' => 'Custom tags'
		);

	public $doc_types_label = 
		array('value' => 'DocType');

	public $doc_types =
		array('html' => 'HTML 4.01', 'xhtml' => 'XHTML');
	
	public $html_options = 
		array(
			'true'
				=> array(
					'label'
						=> array(
							'value' => 'Retain any existing HTML tags',
							'attr' => array('class' => 'tight')
							),
					'initial_value' => 'true',
					'attr'
						=> array()
					)
			);
	
	public $start_tag_label =
		array(
			'value' => 'Start tag:',
			'attr' => array(
				'class' => 'tight'
				)
			);
	
	public $start_tag = 
		array(
			'value' => '',
			'attr' =>
				array(
					'size' => '25',
					'maxlength' => '64'
				)
		);
	
	public $end_tag_label =
		array(
			'value' => 'End tag:'
			);

	public $end_tag = 
		array(
			'value' => '',
			'attr' =>
				array(
					'size' => '25',
					'maxlength' => '64'
				)
		);
	
	public $textarea_original_attr = 
		array(
			'id' => 'original',
			'class' => 'resizable',
			'cols' => '30',
			'rows' => '5'
		);

	public $textarea_new_text_attr = 
		array(
			'id' => 'result',
			'class' => 'resizable',
			'cols' => '30',
			'rows' => '10'
		);
	
	public function __construct() {
		/**
		  * This variable is used to hold all pairs of target characters and
		  * their replacements. These are additional to the more general
		  * replacements made by the PHP htmlentities() function.
		  * 
		  * @see __construct(), clean()
    	  * @var array 
		  */
		$this->custom_chars[] = array("\n", '');
		$this->custom_chars[] = array("\r", '');
		$this->custom_chars[] = array("&rsquo;", "'");
		$this->custom_chars[] = array("&lsquo;", "'");
		$this->custom_chars[] = array("&#039;", "'");
		$this->custom_chars[] = array(chr(34), '"');
		$this->custom_chars[] = array(chr(132), '"');
		$this->custom_chars[] = array(chr(139), "'");
		$this->custom_chars[] = array(chr(145), "'");
		$this->custom_chars[] = array(chr(146), "'");
		$this->custom_chars[] = array(chr(147), '"');
		$this->custom_chars[] = array(chr(148), '"');
		$this->custom_chars[] = array("&rdquo;", '"');
		$this->custom_chars[] = array("&ldquo;", '"');
		$this->custom_chars[] = array("&quot;", '"');
		$this->custom_chars[] = array("&shy;", "-");
		$this->custom_chars[] = array("&ndash;", "-");
		$this->custom_chars[] = array("&#8232;", " ");
		
		parent::__construct($this->max_str_length, $this->custom_chars);
	}

	
}
	
?>